package com.taxi.serviceOrder.remote;

import com.taxi.common.dto.PriceRule;
import com.taxi.common.dto.ResponseResult;
import com.taxi.common.request.PriceRuleIsNewRequest;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * @Author: Ruomeng
 * @Date: 2022/10/20
 * @Description : online-taxi
 * @Version: 1.0
 */
@FeignClient("service-price")
public interface ServicePriceClient {

    @PostMapping("/price-rule/is-new")
    public ResponseResult<Boolean> isNew(@RequestBody PriceRuleIsNewRequest priceRuleIsNewRequest);

//    @RequestMapping(method = RequestMethod.GET,value = "/price-rule/if-exists")
//    public ResponseResult<Boolean> ifPriceExists(@RequestBody PriceRule priceRule);

    @RequestMapping(method = RequestMethod.GET,value = "/price-rule/if-exists/{cityCode}/{vehicleType}")
    public ResponseResult<Boolean> ifPriceExists(@PathVariable("cityCode") String cityCode,@PathVariable("vehicleType") String vehicleType);

    @RequestMapping(method = RequestMethod.POST, value = "/calculate-price")
    public ResponseResult<Double> calculatePrice(@RequestParam Integer distance, @RequestParam Integer duration, @RequestParam String cityCode, @RequestParam String vehicleType);

}
